<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<style>
@-webkit-variables {
    foreground: #008000;
    background: #FFF;
}

body {
    color: -webkit-var(foreground);
    background-color: red;
    background-color: -webkit-var(background);
}
</style>
</head>
<body id="body">
<div id="div">FAILED</div>
<script type="text/javascript">
      if (window.layoutTestController) 
        layoutTestController.dumpAsText();
    var elem = document.getElementById("body");
    var style = document.defaultView.getComputedStyle(elem, null);
    var color = style.getPropertyValue("color");   
    var bgcolor = style.getPropertyValue("background-color");
    var declaration = document.styleSheets[0].rules[0].variables;
    var foregroundValue = declaration.getVariableValue("foreground");
    var backgroundValue = declaration.getVariableValue("background");

    if (color == "rgb(0, 128, 0)" && bgcolor == "rgb(255, 255, 255)"
        && foregroundValue == color && backgroundValue == bgcolor) {
        var elem = document.getElementById("div");
        elem.innerHTML = "PASSED";
    }
</script>
</body>
</html>
